using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UIProcessSchemaObjects;

namespace WebClient
{
    [DefaultEvent("Submit"),
    DefaultProperty("UIProcessForm"),
    ToolboxData("<{0}:UIProcessPresentationControl runat=server></{0}:UIProcessPresentationControl>")]
    public class UIProcessPresentationControl : CompositeControl
    {
        Button submitButton;
        private static readonly object EventSubmitKey = new object();

        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue(null)]
        [Localizable(false)]
        public UIProcessSchemaObjects.Form UIProcessForm
        {
            get
            {
                UIProcessSchemaObjects.Form form = (UIProcessSchemaObjects.Form)ViewState["UIProcessForm"];
                return ((form == null) ? null : form);
            }

            set
            {
                ViewState["UIProcessForm"] = value;
                this.CreateChildControls();
            }
        }

        // The Submit event.
        [
        Category("Action"),
        Description("Raised when the user clicks the button.")
        ]
        public event EventHandler Submit
        {
            add
            {
                Events.AddHandler(EventSubmitKey, value);
            }
            remove
            {
                Events.RemoveHandler(EventSubmitKey, value);
            }
        }

        // The method that raises the Submit event.
        protected virtual void OnSubmit(EventArgs e)
        {
            EventHandler SubmitHandler =
                (EventHandler)Events[EventSubmitKey];
            if (SubmitHandler != null)
            {
                SubmitHandler(this, e);
            }
        }

        // Handles the Click event of the Button and raises
        // the Submit event.
        private void submitButton_Click(object source, EventArgs e)
        {
            OnSubmit(EventArgs.Empty);
        }

        protected override void RecreateChildControls()
        {
            EnsureChildControls();
        }


        protected override void CreateChildControls()
        {
            Controls.Clear();

            // ensure a UIProcessForm has been set
            if (this.UIProcessForm != null)
            {
                // create the table that will be used for the layout of the controls
                Table layoutTable = new Table();
                layoutTable.BorderWidth = 0;
                layoutTable.CellPadding = 5;
                layoutTable.CellSpacing = 0;
                layoutTable.Width = this.Width;

                // walk each FormResource in the UIProcessForm and add them to this control
                foreach (FormResource formResource in UIProcessForm.FormResources)
                {
                    if (formResource is UIProcessSchemaObjects.AddressEntryNA)
                    {
                        UIProcessSchemaObjects.AddressEntryNA _theEntry = (UIProcessSchemaObjects.AddressEntryNA)formResource;
                        CreateAddressEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.AddressEntry)
                    {
                        UIProcessSchemaObjects.AddressEntry _theEntry = (UIProcessSchemaObjects.AddressEntry)formResource;
                        CreateAddressEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.DateTimeEntryNA)
                    {
                        UIProcessSchemaObjects.DateTimeEntryNA _theEntry = (UIProcessSchemaObjects.DateTimeEntryNA)formResource;
                        CreateDateTimeEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.DateTimeEntry)
                    {
                        UIProcessSchemaObjects.DateTimeEntry _theEntry = (UIProcessSchemaObjects.DateTimeEntry)formResource;
                        CreateDateTimeEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.DateEntryNA)
                    {
                        UIProcessSchemaObjects.DateEntryNA _theEntry = (UIProcessSchemaObjects.DateEntryNA)formResource;
                        CreateDateEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.DateEntry)
                    {
                        UIProcessSchemaObjects.DateEntry _theEntry = (UIProcessSchemaObjects.DateEntry)formResource;
                        CreateDateEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.MultiSelectOtherEntry)
                    {
                        UIProcessSchemaObjects.MultiSelectOtherEntry _theEntry = (UIProcessSchemaObjects.MultiSelectOtherEntry)formResource;
                        CreateMultiSelectOtherEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.MultiSelectEntry)
                    {
                        UIProcessSchemaObjects.MultiSelectEntry _theEntry = (UIProcessSchemaObjects.MultiSelectEntry)formResource;
                        CreateMultiSelectEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.NameEntry)
                    {
                        UIProcessSchemaObjects.NameEntry _theEntry = (UIProcessSchemaObjects.NameEntry)formResource;
                        CreateNameEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.NoteEntry)
                    {
                        UIProcessSchemaObjects.NoteEntry _theEntry = (UIProcessSchemaObjects.NoteEntry)formResource;
                        CreateNoteEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.NumberEntryNA)
                    {
                        UIProcessSchemaObjects.NumberEntryNA _theEntry = (UIProcessSchemaObjects.NumberEntryNA)formResource;
                        CreateNumberEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.NumberEntry)
                    {
                        UIProcessSchemaObjects.NumberEntry _theEntry = (UIProcessSchemaObjects.NumberEntry)formResource;
                        CreateNumberEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.PasswordEntry)
                    {
                        UIProcessSchemaObjects.PasswordEntry _theEntry = (UIProcessSchemaObjects.PasswordEntry)formResource;
                        CreatePasswordEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.PhoneEntryNA)
                    {
                        UIProcessSchemaObjects.PhoneEntryNA _theEntry = (UIProcessSchemaObjects.PhoneEntryNA)formResource;
                        CreatePhoneEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.PhoneEntry)
                    {
                        UIProcessSchemaObjects.PhoneEntry _theEntry = (UIProcessSchemaObjects.PhoneEntry)formResource;
                        CreatePhoneEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.PostalCodeEntryNA)
                    {
                        UIProcessSchemaObjects.PostalCodeEntryNA _theEntry = (UIProcessSchemaObjects.PostalCodeEntryNA)formResource;
                        CreatePostalCodeEntryNAControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.PostalCodeEntry)
                    {
                        UIProcessSchemaObjects.PostalCodeEntry _theEntry = (UIProcessSchemaObjects.PostalCodeEntry)formResource;
                        CreatePostalCodeEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.SingleSelectOtherEntry)
                    {
                        UIProcessSchemaObjects.SingleSelectOtherEntry _theEntry = (UIProcessSchemaObjects.SingleSelectOtherEntry)formResource;
                        CreateSingleSelectOtherEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.SingleSelectEntry)
                    {
                        UIProcessSchemaObjects.SingleSelectEntry _theEntry = (UIProcessSchemaObjects.SingleSelectEntry)formResource;
                        CreateSingleSelectEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.TextEntry)
                    {
                        UIProcessSchemaObjects.TextEntry _theEntry = (UIProcessSchemaObjects.TextEntry)formResource;
                        CreateTextEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.UserLoginEntry)
                    {
                        UIProcessSchemaObjects.UserLoginEntry _theEntry = (UIProcessSchemaObjects.UserLoginEntry)formResource;
                        CreateUserLoginEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.YesNoEntry)
                    {
                        UIProcessSchemaObjects.YesNoEntry _theEntry = (UIProcessSchemaObjects.YesNoEntry)formResource;
                        CreateYesNoEntryControls(ref layoutTable, _theEntry);
                    }
                    else if (formResource is UIProcessSchemaObjects.TextPrompt)
                    {
                        UIProcessSchemaObjects.TextPrompt _theEntry = (UIProcessSchemaObjects.TextPrompt)formResource;
                        CreateTextPromptControls(ref layoutTable, _theEntry);
                    }
                }

                if (this.UIProcessForm.FormAction.ActionType == ActionType.SendToWebService)
                {
                    // Create the Submit Button
                    submitButton = new Button();
                    submitButton.ID = "Submit";
                    submitButton.Text = "Submit";
                    submitButton.Click
                    += new EventHandler(submitButton_Click);

                    // add table row for the Submit Button
                    TableRow row = new TableRow();
                    row.VerticalAlign = VerticalAlign.Middle;
                    TableCell cell = new TableCell();
                    cell.ColumnSpan = 3;
                    cell.HorizontalAlign = HorizontalAlign.Right;
                    cell.Controls.Add(submitButton);
                    row.Controls.Add(cell);
                    layoutTable.Controls.Add(row);
                }

                this.Controls.Add(layoutTable);
            }
        }

        protected override void Render(HtmlTextWriter writer)
        {

            base.Render(writer);
        }

        private void CreateAddressEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.AddressEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Address1 field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Address:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Address1";
            textBox.Text = _theEntry.Address1;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Address2 field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Address2";
            textBox.Text = _theEntry.Address2;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the City field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("City:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_City";
            textBox.Text = _theEntry.City;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the State field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("State:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_State";
            textBox.Text = _theEntry.State;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Postal Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Postal Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_PostalCode";
            textBox.Text = _theEntry.PostalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Country Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Country Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_CountryCode";
            textBox.Text = _theEntry.CountryCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateAddressEntryControls(ref Table layoutTable, UIProcessSchemaObjects.AddressEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Address1 field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Address:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Address1";
            textBox.Text = _theEntry.Address1;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Address2 field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Address2";
            textBox.Text = _theEntry.Address2;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the City field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("City:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_City";
            textBox.Text = _theEntry.City;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the State field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("State:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_State";
            textBox.Text = _theEntry.State;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Postal Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Postal Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_PostalCode";
            textBox.Text = _theEntry.PostalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Country Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Country Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_CountryCode";
            textBox.Text = _theEntry.CountryCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateDateTimeEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.DateTimeEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Date:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Date";
            textBox.Text = _theEntry.Date;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Time field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Time:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Time";
            textBox.Text = _theEntry.Time;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }


        private void CreateDateTimeEntryControls(ref Table layoutTable, UIProcessSchemaObjects.DateTimeEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Date:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Date";
            textBox.Text = _theEntry.Date;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Time field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Time:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Time";
            textBox.Text = _theEntry.Time;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateDateEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.DateEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Date:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Date";
            textBox.Text = _theEntry.Date;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateDateEntryControls(ref Table layoutTable, UIProcessSchemaObjects.DateEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Date";
            textBox.Text = _theEntry.Date;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateMultiSelectOtherEntryControls(ref Table layoutTable, UIProcessSchemaObjects.MultiSelectOtherEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            ListBox listBox;
            CheckBox checkBox;

            // add table row for the Selection Field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            listBox = new ListBox();
            listBox.ID = _theEntry.Name + "_Selections";
            foreach (string option in _theEntry.Options)
            {
                listBox.Items.Add(option);
            }
            cell.Controls.Add(listBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Other field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Other:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_OtherSelected";
            checkBox.Checked = _theEntry.OtherSelected;
            cell.Controls.Add(checkBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Other Value field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Other Value:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_OtherValue";
            textBox.Text = _theEntry.OtherValue;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateSingleSelectOtherEntryControls(ref Table layoutTable, UIProcessSchemaObjects.SingleSelectOtherEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            DropDownList dropDownList;
            CheckBox checkBox;

            // add table row for the Selection Field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            dropDownList = new DropDownList();
            dropDownList.ID = _theEntry.Name + "_Selections";
            foreach (string option in _theEntry.Options)
            {
                dropDownList.Items.Add(option);
            }
            cell.Controls.Add(dropDownList);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Other field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Other:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_OtherSelected";
            checkBox.Checked = _theEntry.OtherSelected;
            cell.Controls.Add(checkBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Other Value field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Other Value:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_OtherValue";
            textBox.Text = _theEntry.OtherValue;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateMultiSelectEntryControls(ref Table layoutTable, UIProcessSchemaObjects.MultiSelectEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            ListBox listBox;

            // add table row for the Selection Field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            listBox = new ListBox();
            listBox.ID = _theEntry.Name + "_Selections";
            foreach (string option in _theEntry.Options)
            {
                listBox.Items.Add(option);
            }
            cell.Controls.Add(listBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateSingleSelectEntryControls(ref Table layoutTable, UIProcessSchemaObjects.SingleSelectEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            DropDownList dropDownList;

            // add table row for the Selection Field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            dropDownList = new DropDownList();
            dropDownList.ID = _theEntry.Name + "_Selections";
            foreach (string option in _theEntry.Options)
            {
                dropDownList.Items.Add(option);
            }
            cell.Controls.Add(dropDownList);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateTextEntryControls(ref Table layoutTable, UIProcessSchemaObjects.TextEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_TextValue";
            textBox.Text = _theEntry.TextValue;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateNumberEntryControls(ref Table layoutTable, UIProcessSchemaObjects.NumberEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NumberValue";
            textBox.Text = _theEntry.NumberValue;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateNumberEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.NumberEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NumberValue";
            textBox.Text = _theEntry.NumberValue;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreatePasswordEntryControls(ref Table layoutTable, UIProcessSchemaObjects.PasswordEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Password";
            textBox.Text = _theEntry.Password;
            textBox.TextMode = TextBoxMode.Password;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateUserLoginEntryControls(ref Table layoutTable, UIProcessSchemaObjects.UserLoginEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("User Name:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_UserName";
            textBox.Text = _theEntry.UserName;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Time field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Password:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Password";
            textBox.Text = _theEntry.Password;
            textBox.TextMode = TextBoxMode.Password;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateNameEntryControls(ref Table layoutTable, UIProcessSchemaObjects.NameEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Title field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Title:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NameTitle";
            textBox.Text = _theEntry.NameTitle;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Given Name field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Given Name;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Given";
            textBox.Text = _theEntry.Given;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Middle Name field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Middle Name:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Middle";
            textBox.Text = _theEntry.Middle;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Family Name field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Family Name:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Family";
            textBox.Text = _theEntry.Family;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Suffix field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Suffix:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Suffix";
            textBox.Text = _theEntry.Suffix;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateNoteEntryControls(ref Table layoutTable, UIProcessSchemaObjects.NoteEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the Date field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NoteText";
            textBox.Text = _theEntry.NoteText;
            textBox.TextMode = TextBoxMode.MultiLine;
            textBox.Height = new Unit("200px");
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreatePhoneEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.PhoneEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the National Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("National Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NationalCode";
            textBox.Text = _theEntry.NationalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Country Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Country Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_CountryCode";
            textBox.Text = _theEntry.CountryCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Area Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Area Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_AreaCode";
            textBox.Text = _theEntry.AreaCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Number field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Number:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Number";
            textBox.Text = _theEntry.Number;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Extension field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Extension:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Extension";
            textBox.Text = _theEntry.Extension;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Pin field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Pin:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Pin";
            textBox.Text = _theEntry.Pin;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreatePhoneEntryControls(ref Table layoutTable, UIProcessSchemaObjects.PhoneEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the title for the Entry object
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.ColumnSpan = 3;
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Controls.Add(new LiteralControl(_theEntry.Title));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the National Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("National Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_NationalCode";
            textBox.Text = _theEntry.NationalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Country Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Country Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_CountryCode";
            textBox.Text = _theEntry.CountryCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Area Code field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Area Code:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_AreaCode";
            textBox.Text = _theEntry.AreaCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Number field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Number:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Number";
            textBox.Text = _theEntry.Number;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Extension field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Extension:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Extension";
            textBox.Text = _theEntry.Extension;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Pin field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Pin:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_Pin";
            textBox.Text = _theEntry.Pin;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreatePostalCodeEntryNAControls(ref Table layoutTable, UIProcessSchemaObjects.PostalCodeEntryNA _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;
            CheckBox checkBox;

            // add table row for the PostalCode field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_PostalCode";
            textBox.Text = _theEntry.PostalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);

            // add table row for the Not Applicable field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl("Not Applicable:"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            checkBox = new CheckBox();
            checkBox.ID = _theEntry.Name + "_NotApplicable";
            checkBox.Checked = _theEntry.NotApplicable;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreatePostalCodeEntryControls(ref Table layoutTable, UIProcessSchemaObjects.PostalCodeEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            TextBox textBox;

            // add table row for the PostalCode field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            textBox = new TextBox();
            textBox.ID = _theEntry.Name + "_PostalCode";
            textBox.Text = _theEntry.PostalCode;
            cell.Controls.Add(textBox);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateYesNoEntryControls(ref Table layoutTable, UIProcessSchemaObjects.YesNoEntry _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;
            DropDownList dropDownList;

            // add table row for the YesNo Field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");

            dropDownList = new DropDownList();
            dropDownList.ID = _theEntry.Name + "_Response";
            dropDownList.Items.Add("Yes");
            dropDownList.Items.Add("No");
            cell.Controls.Add(dropDownList);
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }

        private void CreateTextPromptControls(ref Table layoutTable, UIProcessSchemaObjects.TextPrompt _theEntry)
        {
            // local variables
            TableRow row;
            TableCell cell;

            // add table row for the PostalCode field
            row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Width = new Unit("150px");
            cell.Controls.Add(new LiteralControl(_theEntry.Title + ":"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Width = new Unit("10px");
            cell.Controls.Add(new LiteralControl("&nbsp;"));
            row.Controls.Add(cell);

            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Left;
            cell.Width = new Unit("440px");
            cell.Controls.Add(new LiteralControl(_theEntry.Prompt));
            row.Controls.Add(cell);
            layoutTable.Controls.Add(row);
        }
    }
}
